In measuring a sample, or in an inspection device, using an electron microscope (Scanning Electron Microscope: SEM), etc., pattern matching using a reference image (hereinafter also referred to as a template) is performed in order to make fine measurements or to identify the position of an inspection target. In addition, since forming methods that cut out, from an actual SEM image, a region that is to serve as a template are only capable of creating a template after an actual pattern has been formed, and since they involve some effort, methods that create a template using design data for a semiconductor device, a photomask, etc., are beginning to be adopted.
In Patent Document 1, there is described a method of forming an image approximating the actual image by performing a smoothing process on design data that is to serve as a template, and thickening pattern line segments. In addition, in Patent Documents 2 and 3, there are described methods in which a pattern that is to serve as a template is made to resemble the actual image by performing simulation on design data. Further, in Patent Document 4, there is described a method of forming a template having white bands resembling the actual image by adjusting each line segment of the design data.